This invention relates generally to very large scale integration (VLSI) testing, and more particularly to a system and method for on-chip debug support and performance monitoring for microprocessors and microprocessor systems.
It has become very difficult to diagnose failures in and to measure the performance of state-of-the-art very large scale integration (VLSI) chips. This is because modern VLSI chips often not only run at very high clock speeds, but many of them also execute instructions in parallel, out of program order and speculatively. Moreover, visibility of the VLSI chip""s inner state has become increasingly limited due to the complexity of the VLSI chips and to practical constraints on the number of external pads that can be provided on the chip package.
In the past, the traditional failure diagnosis and performance measurement tools have been external logic analyzers and in-circuit emulators. Logic analyzers are capable of monitoring signals on the chip pads and other externally-accessible system signals, capturing the state of these signals and generating triggers based on their states. Unfortunately, logic analyzers must rely solely on externally-accessible signals to accomplish this, not on signals that are internal to the chip itself. In-circuit emulators, on the other hand, are used to mimic the functional characteristics of a new VLSI chip in a system environment and to add visibility to certain data values within the VLSI chip. But such devices only emulate the functionality of the VLSI chip. By their very nature, they cannot give an accurate representation of the performance characteristics of an actual silicon device. Therefore, they are primarily useful only for developing and debugging system software.
Thus, as an alternative or supplement to system emulation, confirmation of operation of an integrated circuit, such as a microprocessor, application specific integrated circuit (ASIC) or similar device, is accomplished using the actual, fabricated device, i.e., the device as produced in xe2x80x9csilicon.xe2x80x9d By applying test signals to the actual device and monitoring its operation, a developer or manufacturer can confirm both logic and electrical functions. Likewise, any problems identified must be debugged and remedied. Visibility inside a chip therefore becomes of paramount importance to address, debug, and correct functional, logical and/or electrical problems.
A certain level of visibility within the chip is provided by external interfaces of the chip. External interfaces can come in several different types. Debug information can be fed out of the chip on the bus interface on unused cycles, or in unused fields on a given cycle. Additionally, prior solutions have provided dedicated pins on the chip to act as a debug port to give visibility into the chip. The pin can be directly attached to a point within the chip for a reading or the pin can provide the ability to mux out important internal information on the dedicated pin. When internal chip information is accessed from either the bus interface or dedicated pin, a logic analyzer or other monitoring device is required to access the information. The use of a logic analyzer or other monitoring device brings with it several disadvantages. First, extra pins dedicated to debug functionality are required in the chip package. These extra pins increase overall costs, and the use of these pins for debug functionality compete with chip functionality resulting in less functionality included within the chip. Secondly, designing and verifying the software to be used with the logic analyzer or other monitoring device to read and interpret the information obtained from the chip is very costly. Finally, attaching the logic analyzer or other monitoring device to the chip to acquire the information competes directly with the proper placement of the chip within the computer system. These difficulties result in longer chip debug schedules.
The number of pins dedicated to debug operations may be reduced by allowing the logic analyzer or other monitoring device to inform the chip as to what debug information is of interest. This can be accomplished by providing elaborate trigger mechanisms to reside within the chip which collapse down to a single trigger out signal to the external logic analyzer. In addition to reducing the number of dedicated pins to debug operations this solution may also provide an earlier insight into the chip logic by allowing the logic analyzer to inform the chip of the area of interest. While this solution does reduce the number of pins dedicated to debug operations, several debug port pins are still required in the design and verification of the logic analyzer software is still costly. Additionally, the trigger solution limits the internal trigger to a specific set of internal source nodes of those that have been predefined and implemented.
Another method of providing information for debugging operations consists of the use of shadow registers. Shadow registers allow an internal trigger or an external trigger fed into the chip to permit the capture of a limited set of information into the shadow registers. The information contained within the shadow registers then can be accessed through the IEEE 1149.1 port (or other scanport or software port) without impacting the normal operations of the chip. Shadow registers are implemented within the chip with the addition of shadow flops. The location of the shadow flops must be predetermined during the chip design phase. Area constraints limit the number of shadow flops that can be placed in the design and the shadow flops tend to be expensive. So debug operations through the use of shadow registers is limited by the number of shadow flops that can be included in the design and by the difficulty in selecting the most likely places for the shadow flops to be required to provide visibility into the functionality of the chip. This problem is further exasperated if multiple cycles of information are required for a node or a bus in order to perform debug operations. The storing of data from multiple registers would require additional flops to be included in the circuit design. However, if a problem were repeatable, multiple cycles of information could be obtained from the chip by successive iterations in which debug information for sequential cycles is obtained. Data obtained in this manner can be interpreted as a virtual logic analyzer trace of the shadow flop locations. While all shadow flops within the chip can be viewed in this manner, if the problem being debugged is not repeatable this process cannot be used.
Alternatively, a trigger can be used to halt the clock of the chip and thereby xe2x80x9cfreezexe2x80x9d all of the information within the chip components. Now all the flops on the normal internal scan chain can be scanned out and the debug information acquired in this manner. Typically a large number of scanable flops are included in the chip design and this inclusion results in only a small increase in the area required. However, in order to perform debug operations in this manner, the clock must be repeatedly halted which interrupts normal operation of the chip during the debug operation. Additionally, repeatability of the system is still required to debug problems which involve multiple cycles of information.
Prior methods and devices have attempted to address testing of very large scale integrated (VLSI) circuits by incorporating testing circuitry into the chip. For example, the IEEE 1149.1 standard specifies a four or five wire serial test bus requiring one pin each for test data in, test data out, test mode select, a test pulse or clock signal and an optional test reset. Because it is serial, this interface is typically limited to providing one bit of test data out for every clock cycle of the unit under test. Thus, capture of test information is limited.
Another system is described in U.S. Pat. No. 5,867,644, issued Feb. 2, 1999, to Ranson, et al., incorporated herein in its entirety by reference, and discloses a user-configurable diagnostic hardware contained on-chip with a microprocessor for debugging and monitoring the performance of the microprocessor. A programmable state machine is coupled to on-chip and off-chip input sources. The state machine may be programmed to look for signal patterns presented by the input sources, and to respond to the occurrence of a defined pattern (or sequence of defined patterns) by driving certain control information onto a state machine output bus. On-chip devices coupled to the output bus take user-definable actions as dictated by the bus. The input sources include user-configurable comparators located within the functional blocks of the microprocessor. The comparators are coupled to storage elements within the microprocessor, and are configured to monitor nodes to determine whether the state of the nodes matches the data contained in the storage elements. By changing data in the storage elements, the programmer may change the information against which the state of the nodes is compared and also the method by which the comparison is made. The output devices include counters having outputs that may be used as state machine inputs, so one event may be defined as a function of a different event having occurred a certain number of times. The output devices also include circuitry for generating internal and external triggers. User-configurable multiplexer circuitry may be used to route user-selectable signals from within the microprocessor to the chip""s output pads, and to select various internal signals to be used as state machine inputs.
Another solution to chip testing is presented in U.S. Pat. No. 6,003,107, issued Dec. 14, 1999, to Ranson, et al and incorporated herein in its entirety by reference. This patent describes circuitry for providing external access to signals that are internal to an integrated circuit chip package. The circuitry includes a N:1 multiplexers distributed throughout the integrated circuit die. Each of the multiplexers has its N inputs coupled to a nearby set of N nodes within the integrated circuit, and each of the multiplexers is coupled to a source of select information operable to select one node from the set of N nodes for external access. The multiplexers outputs are coupled to an externally-accessible chip pad. The integrated circuit is typically a microprocessor, and the source of select information may include a storage element of the microprocessor. If so, additional circuitry may be provided for writing data from a register of the microprocessor to the storage element using one or more microprocessor instructions. Each multiplexer may be coupled to a different source of select information, or all multiplexers may be coupled to the same select information. A fixed set of interconnect traces may be provided to couple a fixed set of nodes to an additional set of externally-accessible chip pads. One or more M:1 multiplexers may also be provided, having their M inputs coupled to M different outputs of the N:1 multiplexers. Each of the M:1 multiplexers may be coupled to a second source of select information. Preferably, the outputs of the M:1 multiplexers will be coupled to a circuitry for facilitating debug and performance monitoring of the integrated circuit.
However, these systems require some compromise between on-chip storage capabilities, pins available for providing signal and data samples, and multiplexing required to provide plural outputs on each available pin. For example, a large on-chip storage capability means additional chip area dedicated to functions that may not be used or even made available after debugging and circuit operation is verified. Even when chip area can be spared, the stored test results must be accessed by providing some combination of pins and clock cycles to multiplex the results out onto the pins. As the number of pins available is often substantially less than the number of parameters, signals, and data bits to be provided, the onboard test memory must act as a buffer. However, as the circuit under test continues to operate and test results are generated more quickly than the pin count will permit providing thereof, the memory will rapidly continue to fill until, eventually, an overflow condition will be reached, data lost, and circuit operation compromised.
Accordingly, a need exists for a way to collect test and debug data from an integrated circuit without requiring an inordinate number of test output pins or on-chip test memory size.
According to an aspect of the invention, external access is provided to signals that are internal to an integrated circuit chip package. Test circuitry includes a distributed data sampling network having multiplexers physically distributed throughout the integrated circuit die. Each of the multiplexers has some or all of its inputs coupled to nearby sets of nodes within the integrated circuit. An event trigger generator receives a first N bits of sampled data from the network and, using a programmable mask, selectively performs one or more boolean operations on the sampled data to provide an event trigger. The event trigger may further include a switch for selectively providing, as the event trigger, (i) a result of the boolean operation on the sampled data, (ii) a performance counter event signal, or (iii) an externally applied trigger signal.
The test circuitry may further include a counter providing an intermediate trigger in response to a predetermined number of the event triggers. A trigger delay may provide a sample command a predetermined number of cycles following the intermediate trigger. The cycles may be operating, clock, processor, or other cycles of or used by the integrated circuit under test of the test circuit itself.
The test circuitry may further include a programmable register storing a value corresponding to the predetermined number of cycles. The programmable register selectively increments the value corresponding to the predetermined number of cycles by a predetermined number of the cycles. This feature allows for capturing successive sequences of test data over multiple test runs.
The test circuitry may further include a trigger delay providing a sample command a predetermined number of cycles following the event trigger. A memory, such as a FIFO, may be used to receive and store the data wherein new data is stored in favor of automatically discarded oldest data. Output circuitry may be used to provide portions of the samples, combining the samples to form composite sample groups spanning multiple sampling periods. A counter or clock output may form part of each group to indicate relative or clock time at which the sample was obtained.
According to a feature of the invention, a trigger event counter is configured to provide an intermediate trigger in response to a programmable number of a first type of the event triggers. A similarly configured store event counter initiates a storage of data samples over a programable number of sequential cycles in response to a second type of the event triggers. A post trigger counter may initiate processing of the data samples in response to storage of a programmable number of the data samples. A FIFO type memory may be used to store the data samples. A pretrigger store event responds to an armed command for initiating a storage of the data samples during a period beginning prior to, and ending in response to, the first type of trigger.
According to another aspect of the invention, a test device includes a state machine responsive to (i) an arm command for transitioning from a standby state to an armed state, (ii) a final trigger event for transitioning from the armed state to a triggered state, and (iii) a post trigger count event for transitioning from the triggered state to the standby state. A controller provides the arm command and issues appropriate configuration controls to collect signal samples. In particular, a network responds to these commands from the controller to selectively provide signal samples from a device under test. An event trigger generator responds to logic or other characteristics of the signal samples to provide an event trigger. These event triggers are counted by an event trigger counter in the armed state of the state machine to identify the final trigger event corresponding to an occurrence of a programmable number of the event triggers. A store trigger generator also responds to a programmed characteristic or combination(s) of the signal samples to provide a store trigger. Either or both of the trigger generators may use a mask to provide these triggers. A post trigger sample counter operable in the triggered state to provide the post trigger count event in response to a programmable number of signal samples being captured. A memory operates in the triggered state to store the samples being captured. The memory may be additionally operable in the armed state to store samples occurring prior to the targeted samples so as to provide test data from cycles prior to the targeted events.
According to another aspect of the invention, a method provides external access to signals that are internal to an integrated circuit chip package. The method includes a step of receiving a plurality of N bit wide signals at locations distributed throughout the integrated circuit die. One of the signals is selected and masked to provide event triggers. An intermediate trigger is generated once a predetermined (programmable) number of the triggers are detected. This intermediate trigger may be delayed a number of cycles prior to initiation of test data capture.
According to another aspect of the invention, a method includes defining a plurality of states including (i) standby, (ii) armed, and (iii) triggered. Transition steps define state changes including:
transitioning from the standby state to the armed state in response to an arm trigger;
transitioning from the armed state to the triggered state in response to final trigger event; and
transitioning from the triggered state to the standby state in response to post trigger count event.
Signal samples are selectively provided (e.g., collected from multiple points and multiplexed down) from a device under test. The signal samples are subject to programmable boolean operations to provide the event triggers and the store triggers. In the armed state, a programmable number of the event triggers may be counted to provide the final trigger event thereby causing the state machine to transition to the triggered state. A programmed number of the signal samples are stored in response to each store event. Store events may be generated during both the armed and the trigger states to provide for the collection of data immediately prior to the trigger state. Using a FIFO memory, excessive amounts of data stored prior to the final event trigger are lost in preference to storage of later data. A pseudo clock value may be inserted into a portion of the FIFO memory to provide a relative time stamp for the associated data stored in the FIFO. A step of counting a programmable number of signal samples in the triggered state results in provision of the post trigger count event, terminating data sampling and possibly initiating output or other processing of the collected data samples.
The foregoing has outlined rather broadly the features and technical advantages of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention will be described hereinafter which form the subject of the claims of the invention. It should be appreciated by those skilled in the art that the conception and specific embodiment disclosed may be readily utilized as a basis for modifying or designing other structures for carrying out the same purposes of the present invention. It should also be realized by those skilled in the art that such equivalent constructions do not depart from the spirit and scope of the invention as set forth in the appended claims.